This invention relates to a microcomputer for control purposes. More particularly, the invention relates to such a microcomputer provided with a function for sensing an abnormality in the execution of a control program if an abnormality should occur.
A microcomputer for control purposes is generally adapted to read a plurality of control programs stored in a memory circuit from the memory to a central processing unit (hereafter referred to as a "CPU") through a data bus in a predetermined sequence so that the programs may be executed by the CPU in the predetermined sequence. However, there are occasions where the programs fails to be executed in the predetermined sequence, as in the event of occurrence of noise or some other disturbance.
Microcomputers developed to deal with this situation exist and are equipped with a monitoring timer, or so-called "watchdog timer", for monitoring execution of control programs at all times to determine whether the programs are being run correctly. In a microcomputer of this type, the arrangement is such that the monitoring timer is reset in response to an interrupt signal generated by a timer for interrupt processing. If the interrupt signal fails to be generated, the monitoring timer will not be reset and will run out of time. When this occurs, the microcomputer deems that an abnormality such as runaway of the CPU has developed, and the design is such that the CPU is restarted and a warning is issued or, alternatively, such that a back-up circuit is started.
However, malfunctions can occur in which the interrupt processing is executed in an incessant or freguent manner due to a fault in the CPU interrupt timer or superposition of noise upon the interrupt signal, or in which a loop that includes the monitoring timer reset instruction is rendered endless. In the event of malfunctions such as these, the monitoring timer will be continuously reset and will never run out of time though the malfunctions exist, thus failing to execute the above-mentioned fail-safe functions, etc.